package com.buka.service;

import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Service;

@Service
public class CarService {

    @RabbitListener(bindings = @QueueBinding(
            exchange = @Exchange(value = "buka", type = ExchangeTypes.DIRECT),
            value=@Queue(name="carLocation"),
            key = "location"

    ))
    public void carLocation(String  message){
        System.out.println("carLocation:"+message);
    }

}
